<html><head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
		<title>我的预定</title>
		<script src="__INDEX__/js/mui.min.js"></script>
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/css/style.css" />
		<link rel="stylesheet" href="__INDEX__/css/index.css" />	
	</head>
	<style>
		.slist_tlis .active {
		    border-bottom: 2px solid #2783e7;
		}
	</style>

	<body class="mui-ios mui-ios-11 mui-ios-11-0">
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">我的预定</h1>
		</header>
		
		<div class="mui-content">
			<div class="shoplist_top">
				<ul class="slist_tlis clearfix">
					<li class="active"><a href="javascript:;">客房预定</a></li>
					<li ><a href="{:url('index/member/reserve_ct')}">餐厅预定</a></li>
				</ul>
				
			</div>
			<div class="shoplist_box">
				<ul class="index_sjlist" id="store_ul">
					 
				</ul>
			</div>
		</div>
		<input type="hidden" id="type" value="{$type}" /> 
		<input type="hidden" id="page" value="1" /> 
<script src="__INDEX__/js/jquery.js"></script>
<script type="text/javascript" src="__INDEX__/js/layer/layer.min.js"></script> 
<script> 
	get_data(); 
	var hasdata=true;
	function get_data() { 
		if(hasdata==false){
			return;
		}
		$.ajax({
			type: "post",
			data: {  
				type: $('#type').val(),
				page: $('#page').val()
			},
			url: "{:url('index/member/reserve')}",
			success: function(data) {  
				var html = "";
				if(data.list&&data.list.length>0) { 
					var list=data.list; 
					for(var o in list) { 
						var log = list[o]; 
						var state = '';
						var url = "/index/member/reserve_det?r_id="+log.id;
						if(log.state == 2){
							if(log.is_hx==1){
								state = '已完成';
							}else{ 
							    state = '待核销';
							}
						}else if(log.state==1){
							state = '待付款';
						}else if(log.state==0){
							state = '待商家受理';
						}else if(log.stgate==3){
							state = '商家已受理';
						}
						var img = '';
						var room_name = '';
						var start_time = '';
						if(log.type == 2){
							img = log.thumb; 
							room_name = '';
							start_time = '';
						}else{
							img = log.room_img;
							room_name = log.room_name ? log.room_name : '';
							start_time = log.start_time ? log.start_time : '';
						}
						html +=  '<li>'
						     +'<a href="'+url+'" class="clearfix">'
						     +'<div class="index_sjimg"><img src="'+img+'"></div>'
						     +'<div class="index_sjinfo">'
						     +'<div class="index_spname"><span style="float: right;font-size: 12px;">'+state+'</span>'+log.store_name+''+room_name+'</div>'
						     +'<div class="index_spadr clearfix">'
						     +'<div class="index_spadr_l">预约时间：'+start_time+''+log.dd_time+'</div>'
						     +'<div class="index_spadr_l">总价：￥'+log.balance+'</div>'
						     +'<div class="index_spadr_r"><button class="btn-sub">查看</button></div>'
						     +'</div>'
						     +'</div>'
						     +'</a>'
						     +'</li>'  
					}
					 
					if($('#page').val() == 1){
						$('.index_sjlist').html(html); 
					}else{
						$('.index_sjlist').append(html); 
					}
					
				}else{
					if($('#page').val() == 1){
						hasdata=false;
					    $(".index_sjlist").html('<div style="background-color: #efeff4;text-align:center;margin-top:220px">暂无数据</div>');
					}
				} 
			}
		});
	} 

	$(window).scroll(function(){
		var scrollTop = $(window).scrollTop();       //滚动条高度
		var bodyheight = $(document).height();         //文档的高度
		var windowheight = window.innerHeight;	//$(window).height();              //当前窗体的高度
		if((bodyheight - windowheight - scrollTop) == 0){ 
			var index = layer.load(1, {shade: false,time: 1.5 * 1000});
			var page = $("#page").val();
			page++;
			$("#page").val(page); 
			get_data();
		}				
	})
</script>
